<?php
defined('BASEPATH') or exit('No direct script access allowed');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="<?php echo base_url()?>css/tutorial.css" rel="stylesheet"
	type="text/css" />
<title>页面跳转</title>

<script type="text/javascript">

function askAjaxData(){

	if (window.XMLHttpRequest)
	{
		// IE7+, Firefox, Chrome, Opera, Safari 浏览器执行的代码
		xmlhttp=new XMLHttpRequest();
	}
	else
	{	
		//IE6, IE5 浏览器执行的代码
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}

	//创建对象
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			$data = xmlhttp.responseText;
            alert($data);

		}
	}
	var name ='炽天使';
	xmlhttp.open("GET","<?php echo site_url('Ajax/getAjaxData')?>"+"/name/"+name,true);
	xmlhttp.send();
}

</script>
</head>
<body>

	<h1>ajax教程!</h1>
	<div id="container">
		<div id="body">

			<code onclick="askAjaxData()">获得Ajax.php中</code>

		</div>
	</div>



</body>
</html>

